package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
@ToString
public class SystemDictionaryItem {
    private Long id;
    private SystemDictionary systemdictionary;
    private String title;
    private Integer sequence;

    public String getJsonData(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",this.id);
        map.put("title",this.title);
        map.put("sequence",this.sequence);
        if(this.systemdictionary!=null){
            map.put("systemdictionaryId",systemdictionary.getId());
            map.put("systemdictionarySn",systemdictionary.getSn());
            map.put("systemdictionaryTitle",systemdictionary.getTitle());
            map.put("systemdictionaryIntro",systemdictionary.getIntro());
        }else{
            this.systemdictionary= new SystemDictionary();
        }
        return JSON.toJSONString(map);
    }

}